home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / Chip_2004-10_cd1.bin / tema / where / Setup.exe / {app} / DescAPI / DescAPI.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-02-01  |  8.9 KB  |  337 lines

  1. //************************************************************************
  2. //
  3. // DescAPI.h
  4. //
  5. // C/C++ declarations for DescAPI 2.20 (WhereIsIt ver. 3.50 and newer)
  6. //
  7. // (c) Robert Galle, April 2003
  8. //
  9. // Modified by Emanuele Ruffaldi October 2001
  10. // 1) added ifndef block
  11. // 2) modified syntax of stdcall for VC++
  12. //
  13. //************************************************************************
  14.  
  15. #ifndef DESCAPI_H
  16. #define DESCAPI_H
  17.  
  18.  
  19. #define MAXDESCLENGTH   32768
  20. #define MAXALIASLENGTH  255
  21.  
  22. #define ptReserved            0
  23. #define ptSameFile            1
  24. #define ptParentItem          2
  25. #define ptItemList            3
  26. #define ptDiskInfo            4
  27. #define ptCDDB                5
  28. #define ptFormatting          6
  29. #define ptThumbnails          7
  30. #define ptCustomIcons         8
  31. #define ptFileNameFormatting  9
  32.  
  33. #define DT_FLOPPY525_360     0
  34. #define DT_FLOPPY525_12      1
  35. #define DT_FLOPPY35_720      2
  36. #define DT_FLOPPY525_8SD     3
  37. #define DT_FLOPPY525_8DD     4
  38. #define DT_HARDDISK          5
  39. #define DT_TAPEDRIVE         6
  40. #define DT_FLOPPY35_144      7
  41. #define DT_OPTICAL           8
  42. #define DT_FLOPPY35_288      9
  43. #define DT_CDROM             10
  44. #define DT_NETWORK           11
  45. #define DT_RAMDISK           12
  46. #define DT_REMOVABLE         13
  47. #define DT_ZIPDRIVE          14
  48. #define DT_JAZDRIVE          15
  49. #define DT_ZIPDRIVEPLUS      16
  50. #define DT_SEAGATEDIRECTTAPE 17
  51. #define DT_LS120             18
  52. #define DT_MOS320            19
  53. #define DT_MOS332            20
  54. #define DT_M2531A            21
  55. #define DT_JAZ2DRIVE         22
  56. #define DT_ZIP250            23
  57. #define DT_AUDIOCD           24
  58. #define DT_DVD               25
  59. #define DT_CDR               26
  60. #define DT_CDRW              27
  61. #define DT_DVDR              28
  62. #define DT_DVDRAM            29
  63. #define DT_DVDRW             30
  64. #define DT_DVDPLUSRW         31
  65. #define DT_DVDPLUSR          32
  66. #define DT_DDCDROM           33
  67. #define DT_DDCDR             34
  68. #define DT_DDCDRW            35
  69. #define DT_DISKGROUP         254
  70. #define DT_UNKNOWN           255
  71.  
  72.  
  73. // Plugins can use the following error code with SetLastError() function
  74. // to abort disk scanning. This code should be used with unrecoverable
  75. // errors that affect scanning altogether, for example if plugin detects
  76. // that media is no longer available
  77.  
  78. #define ERR_AbortScan = $FFFA8047;
  79.  
  80.  
  81. #define pdsUserDefined_EnabledFirstTime    0
  82. #define pdsUserDefined_DisabledFirstTime   1
  83. #define pdsForceAlwaysEnabled              2
  84. #define pdsForceAlwaysDisabled             3
  85.  
  86.  
  87. // structures
  88.  
  89. typedef struct {
  90.   LPTSTR    lpszModuleName;
  91.   LPTSTR    lpszAuthor;
  92.   LPTSTR    lpszVersion;
  93. } MODULEINFOREC, FAR *LPMODULEINFOREC;
  94.  
  95. typedef struct {
  96.   BOOL      bImportingDesc;     
  97.   BOOL      bImportingAlias;
  98. } PLUGINCAPABILITIESREC, FAR *LPPLUGINCAPABILITIESREC;
  99.  
  100. typedef struct {
  101.   LPTSTR    lpszRootPath;
  102.   LPTSTR    lpszVirtualRoot;
  103.   LPTSTR    lpszVolumeLabel;
  104.   LPTSTR    lpszFSName;
  105.   int       iMaxNameLength;
  106.   DWORD     dwSerialNumber;
  107.   WORD      wDiskNum;
  108.   WORD      wMediaType;
  109.   int        iBytesPerSector;
  110.   int       iSectorsPerCluster;
  111.   int       iTotalClusters;
  112.   int       iFreeClusters;
  113.   int       iNumberOfFiles;
  114.   int       iNumberOfCompressedFiles;
  115.   WORD      wNumberOfDirs;
  116. } DISKINFORECORD, FAR *LPDISKINFOREC;
  117.  
  118. typedef struct {
  119.   LPTSTR    lpszFolderPath;
  120.   int64     iSize;
  121.   BYTE      bAttribute;
  122.   int       iDateCreated;
  123.   int       iDateModified;
  124.   int       iDateAccessed;
  125. } FOLDERINFORECORD, FAR *LPFOLDERINFOREC;
  126.     
  127. typedef struct {    
  128.   LPTSTR    lpszFileName;
  129.   int64     iSize;
  130.   BYTE      bAttribute;
  131.   int       iDateCreated;
  132.   int       iDateModified;
  133.   int       iDateAccessed;
  134. } FILEINFORECORD, FAR *LPFILEINFOREC;    
  135.  
  136. typedef struct {
  137.   LPTSTR    lpszFileName;
  138.   LPTSTR    lpszDesc;
  139.   LPTSTR    lpszAliasName;
  140.   PROC      lpRequireFileProc;
  141.   WORD      wMaxDescSize;
  142.   BOOL      bSilentMode;
  143.   HANDLE    hOwnerWnd;
  144. } IMPORTSAMEFILEREC, FAR *LPIMPORTSAMEFILEREC;
  145.  
  146. typedef struct {
  147.   LPTSTR    lpszDrive;
  148.   LPTSTR    lpszFolderPath;
  149.   LPTSTR    lpszDesc;
  150.   LPTSTR    lpszAliasName;
  151.   PROC      lpRequireFileProc;
  152.   WORD      wMaxDescSize;
  153.   BOOL      bSilentMode;
  154.   HANDLE    hOwnerWnd;
  155. } IMPORTFOLDERREC, FAR *LPIMPORTFOLDERREC;
  156.  
  157. typedef struct {
  158.   LPTSTR    lpszParentName;
  159.   LPTSTR    lpszFileList;
  160.   LPTSTR    lpszDesc;
  161.   LPTSTR    lpszAliasName;
  162.   PROC      lpRequireFileProc;
  163.   WORD      wMaxDescSize;
  164.   BOOL      bSilentMode;
  165.   HANDLE    hOwnerWnd;
  166. } IMPORTPARENTITEMREC, FAR *LPIMPORTPARENTITEMREC;
  167.  
  168. typedef struct {
  169.   LPTSTR    lpszParentName;
  170.   LPTSTR    lpszFileList;
  171.   PROC      lpRequireFileProc;
  172.   PROC      lpStoreDescProc;
  173.   PROC      lpStoreAliasProc;
  174.   WORD      wMaxDescSize;
  175.   BOOL      bSilentMode;
  176.   HANDLE    hOwnerWnd;
  177. } IMPORTITEMLISTREC, FAR *LPIMPORTITEMLISTREC;
  178.  
  179. typedef struct {
  180.   LPDISKINFOREC lpDiskInfo;
  181.   LPTSTR    lpszDesc;
  182.   LPTSTR    lpszDiskName;
  183.   LPTSTR    lpszCDDBQueryID;
  184.   WORD      wMaxDescSize;
  185.   BOOL      bSilentMode;
  186.   HANDLE    hOwnerWnd;
  187. } IMPORTDISKINFOREC, FAR *LPIMPORTDISKINFOREC;
  188.  
  189. typedef struct {
  190.   LPTSTR    lpszDesc;
  191.   WORD      wMaxDescSize;
  192.   LPTSTR    lpszSourceModuleFile;
  193.   WORD      wSourcePluginID;
  194.   HANDLE    hOwnerWnd;
  195. } FORMATDESCREC, FAR *LPFORMATDESCREC;
  196.  
  197. typedef struct {
  198.   LPTSTR    lpszFileName;
  199.   LPTSTR    lpszFullPath;
  200.   BOOL      bIsDirectory;
  201.   BOOL      bIsCompressed;
  202.   HANDLE    hOwnerWnd;
  203. } FORMATFILENAMEREC, FAR *LPFORMATFILENAMEREC;
  204.  
  205. typedef struct {
  206.   LPTSTR    lpszFileName;
  207.   WORD      wXSize;
  208.   WORD      wYSize;
  209.   HANDLE    hBitmapHandle;
  210.   PROC      lpRequireFileProc;
  211.   BOOL      bSilentMode;
  212.   HANDLE    hOwnerWnd;
  213. } IMPORTTHUMBNAILREC, FAR *LPIMPORTTHUMBNAILREC;
  214.  
  215. typedef struct {
  216.   LPTSTR    lpszItemPath;
  217.   HANDLE    hIconHandle;
  218.   BOOL      bSilentMode;
  219.   HANDLE    hOwnerWnd;
  220. } IMPORTCUSTOMICONREC, FAR *LPIMPORTCUSTOMICONREC;
  221.  
  222.  
  223. // callback functions
  224.  
  225. typedef void   (__stdcall *TCONFIGPLUGINPROC)
  226.    (HANDLE  hInstance,
  227.     HANDLE  hOwnerWnd,
  228.     WORD    wPluginNumber
  229.    );
  230.  
  231. typedef int (__stdcall *TREGISTERPLUGINPROC)
  232.    (WORD    wPluginID,
  233.     BYTE    wPlugintype,
  234.     LPTSTR  lpszPluginDescription,
  235.     LPTSTR  lpszPluginFileMask,
  236.     TCONFIGPLUGINPROC  PluginConfigurationCallBack
  237.    );
  238.    
  239. typedef int (__stdcall *TREGISTERRUNTIMEPLUGINPROC)
  240.    (WORD    wPluginID,
  241.     BYTE    wPlugintype,
  242.     LPTSTR  lpszPluginName,
  243.     LPTSTR  lpszFileMask,
  244.     LPTSTR  lpszMenuOption,
  245.     BOOL    bRequiresMedia,
  246.     TCONFIGPLUGINPROC  PluginConfigurationCallBack
  247.    );
  248.  
  249. typedef LPTSTR (__stdcall *TREQUIREFILEPROC)
  250.    (LPTSTR  lpszFileName
  251.    );
  252.  
  253. typedef BOOL (__stdcall *TSTOREDESCPROC)
  254.    (LPTSTR  lpszFileName,
  255.     LPTSTR  lpszDesc
  256.    );
  257.  
  258. typedef BOOL (__stdcall*TSTOREALIASNAMEPROC)
  259.    (LPTSTR  lpszFileName,
  260.     LPTSTR  lpszAliasName
  261.    );
  262.    
  263.  
  264. // function prototypes
  265. // defined here as function types with added "_Proc" in the name, implement
  266. // in your code as regular functions and export them from your DLL.
  267.  
  268. typedef void (__stdcall*ModuleInfoEx_Proc)
  269.    (LPMODULEINFOREC ModuleInfo);
  270.  
  271. typedef void (__stdcall*RegisterDescPlugins_Proc)
  272.    (TREGISTERPLUGINPROC RegisterPluginProc);
  273.    
  274. typedef void (__stdcall*RegisterRuntimePlugins_Proc)
  275.    (TREGISTERRUNTIMEPLUGINPROC RegisterRuntimePluginProc);   
  276.  
  277. typedef BYTE (__stdcall*PluginDefaultState_Proc)
  278.    (WORD wPluginID);
  279.    
  280. typedef int (__stdcall*PluginCapabilities_Proc)
  281.    (WORD wPluginID,
  282.     LPPLUGINCAPABILITIESREC PluginCapabilities);
  283.  
  284. typedef bool (__stdcall*ValidateRuntimePlugin_Proc)
  285.    (WORD    wPluginID,
  286.     LPDISKINFOREC lpDiskInfo,
  287.     LPFOLDERINFOREC lpFolderInfo,
  288.     LPFILEINFOREC lpFileInfo);   
  289.  
  290. typedef void (__stdcall*InitDescImport_Proc)
  291.    ();
  292.  
  293. typedef void (__stdcall*DoneDescImport_Proc)
  294.    ();
  295.    
  296. typedef void (__stdcall*InitVCLImport_Proc)
  297.    (HANDLE  hAppHandle);
  298.   
  299. typedef int (__stdcall*ImportDesc_SameFileEx_Proc)
  300.    (WORD    wPluginID,
  301.     LPIMPORTSAMEFILEREC ImportSameFile);
  302.  
  303. typedef int (__stdcall*ImportDesc_FolderEx_Proc)
  304.    (WORD    wPluginID,
  305.     LPIMPORTFOLDERREC ImportFolder);
  306.  
  307. typedef int (__stdcall*ImportDesc_ParentItemEx_Proc)
  308.    (WORD    wPluginID,
  309.     LPIMPORTPARENTITEMREC ImportParentItem);
  310.  
  311. typedef int (__stdcall*ImportDesc_ItemListEx_Proc)
  312.    (WORD    wPluginID,
  313.     LPIMPORTITEMLISTREC ImportItemList);
  314.  
  315. typedef int (__stdcall*ImportDesc_DiskInfoProcEx_Proc)
  316.    (WORD    wPluginID,
  317.     LPIMPORTDISKINFOREC ImportDiskInfo);
  318.  
  319. typedef int (__stdcall*FormatDescriptionProcEx_Proc)
  320.    (WORD    wPluginID,
  321.     LPFORMATDESCREC FormatDesc);
  322.     
  323. typedef int (__stdcall*FormatFileNameProcEx_Proc)
  324.    (WORD    wPluginID,
  325.     LPFORMATFILENAMEREC FormatFileName);    
  326.  
  327. typedef int (__stdcall*ImportThumbnailProcEx_Proc)
  328.    (WORD    wPluginID,
  329.     LPIMPORTTHUMBNAILREC ThumbnailData);
  330.     
  331. typedef int (__stdcall*ImportCustomIconProcEx_Proc)
  332.    (WORD    wPluginID,
  333.     LPIMPORTCUSTOMICONREC CustomIconData);
  334.  
  335.  
  336. #endif
  337.